package com.hd.controller;

import com.hd.entity.User;
import com.hd.service.IUserService;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Value("${server.port}")
    String port;

    @Autowired
    IUserService userService;

    @PostMapping("hi")
    private Object hi(PageQuery pageQuery) throws Exception {

        userService.hi(pageQuery);
        return pageQuery;
    }

    @PostMapping("saveUser")
    private Object saveUser(User user) throws Exception {

        userService.saveUser(user);
        return "保存成功";
    }
}
